package com.vne.skyemart.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.vne.skyemart.dao.UserTypeDao;
import com.vne.skyemart.model.UserType;
import com.vne.skyemart.service.UserTypeService;

@Service("userTypeService")
@Transactional(propagation = Propagation.SUPPORTS,readOnly = true)
public class UserTypeServiceImpl implements UserTypeService{
	@Autowired
	private UserTypeDao userTypeDao;

	public UserTypeDao getUserTypeDao() {
		return userTypeDao;
	}

	public void setUserTypeDao(UserTypeDao userTypeDao) {
		this.userTypeDao = userTypeDao;
	}
	public UserTypeServiceImpl() {}
	@Transactional(propagation = Propagation.SUPPORTS,readOnly = false)
	@Override
	public void addUserType(UserType usertype) {
		userTypeDao.save(usertype);
	}

	@Override
	public List<UserType> listUserType() {
		return userTypeDao.findAll();
	}
	
}
